﻿using System;
using System.Collections.Generic;
using System.Text;
using DAL;
using Model;

namespace BLL
{
    public class Config : BaseService<ConfigInfo>
    {
        private static readonly DAL.Config dal = new DAL.Config();

        public override void SetCurrentRepository()
        {
            this.CurrentRepository = dal;
        }

        public IList<ConfigInfo> Config_GetAll_forSingleType(enum_configType type)
        {
            IList<ConfigInfo> list = new List<ConfigInfo>();
            foreach (ConfigInfo c in this.LoadEntities())
            {
                if (c.TypeID == (int)type)
                    list.Add(c);
            }
            return list;
        }
    }

    public class ConfigType
    {
        private static readonly DAL.ConfigType dal = new DAL.ConfigType();

        public IList<ConfigTypeInfo> LoadEntities()
        {
            return dal.LoadEntities();
        }
    }
}
